package com.heihei.itextdemo.controller;

import com.heihei.itextdemo.service.DownPdfService;
import com.itextpdf.text.DocumentException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@RestController
@RequestMapping("/down")
@Api(value = "下载", tags = "下载")
public class DownPdfController {
    @Resource
    private DownPdfService downPdfService;

    @GetMapping("/download-report-pdf")
    @ApiOperation(value = "下载报表（pdf）")
    public void downPdfReport(HttpServletResponse response) throws IOException, DocumentException {
        downPdfService.downPdfReport(response);
    }

}